home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / basic / DLL.lha / DLL / Compare_Strings_I.asc next >
Encoding:
Text File  |  2000-08-26  |  852 b   |  36 lines

  1. Function.w COMPARE_STRINGS{*s1,*s2}
  2. .ASM_strcmpi
  3.         MOVEA.l d0,a0
  4.         MOVEA.l d1,a1
  5.  
  6.         MOVE.b  #96,d2
  7.         MOVE.b  #123,d3
  8.         MOVE.b  #$DF,d4
  9.  
  10. 'fetch: MOVE.b  (a1)+,d1
  11.         MOVE.b  (a0)+,d0
  12.  
  13.         BEQ     'exit       ; check if letter is null terminator
  14.  
  15.         CMP.b   d2,d0
  16.         BLE     'noup1
  17.         CMP.b   d3,d0
  18.         BGE     'noup1
  19.         AND.b   d4,d0
  20.  
  21. 'noup1: CMP.b   d2,d1
  22.         BLE     'noup2
  23.         CMP.b   d3,d1
  24.         BGE     'noup2
  25.         AND.b   d4,d1
  26.  
  27. 'noup2: CMP.b   d0,d1       ; check if letters are same
  28.         BEQ     'fetch      ; if they are, move onto next kletter
  29.  
  30. 'exit:  ANDI.w  #$00FF,d0   ; make sure that top byte of word is clear
  31.         ANDI.w  #$00FF,d1   ; make sure that top byte of word is clear
  32.         SUB.w   d1,d0       ; get return result
  33.         AsmExit
  34. End Function
  35.  
  36.